package monitorbelongto;

import java.util.concurrent.TimeUnit;

public class Phone {


    public static synchronized void sendSMS() {
        System.out.println("开始发送短信");
            try {
                TimeUnit.SECONDS.sleep(3);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        System.out.println(Thread.currentThread().getName() + "发送短信成功");

    }


    public static synchronized void playGame() {

            System.out.println(Thread.currentThread().getName() + "原神启动");
            try {
                TimeUnit.SECONDS.sleep(3);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        System.out.println("原神启动成功");

    }


}
